package org.niux.aims.action.ajax;

import javax.annotation.Resource;

import org.niux.aims.common.web.AimsBaseAction;
import org.niux.aims.service.IAccountService;
import org.niux.aims.service.ILogsService;
import org.niux.aims.vo.AccountVO;

/**
 * 
 * Copyright (c) 2013,茂名市国土资源局<br>
 * All rights reserved.<br>
 * 
 * 文件名称：ResetPasswordAjax.java<br>
 * 摘    要：重置密码类<br>
 * <br>
 * 当前版本：<br>
 * 作    者：梁铭显 Email: <a href="mailto:liangmingxian@gmail.com">liangmingxian@gmail.com</a><br>
 * 完成日期：2013-11-22<br>
 * <br>
 * 取代版本：<br>
 * 原作者  ：<br>
 * 完成日期：2013-11-22<br>
 */
public class ResetPasswordAjax extends AimsBaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1369613954174653404L;

	@Resource(name="accountService")
	private IAccountService accountService;
	
	@Resource(name="logsService")
	private ILogsService logsService;
	
	private String accountid;
	
	private String rs;
	
	/**
	 * 
	 * 方法概述：重置密码
	 * 描述：重置密码
	 * @return
	 * 返回类型：String
	 * 修改人：梁铭显 
	 * 修改时间：2013-11-22
	 */
	public String resetPassword() {
		AccountVO accountVo = new AccountVO();
		accountVo.setId(Integer.parseInt(accountid));
		accountVo.setPassword("123456");
		
		accountService.updatePassword(accountVo);
		
		logsService.addLog("【"+((AccountVO)super.getSession().get("account")).getName()+"】重置ID为："+accountid+"的用户的密码");
		
		rs = "1";
		
		return SUCCESS;
	}

	public String getAccountid() {
		return accountid;
	}

	public void setAccountid(String accountid) {
		this.accountid = accountid;
	}

	public String getRs() {
		return rs;
	}

	public void setRs(String rs) {
		this.rs = rs;
	}
}
